package org.huanmin.webframe;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.env.Environment;

@SpringBootApplication(scanBasePackages = "org.huanmin.webframe")
@Slf4j
public class WebframeApplication {
    public static void main(String[] args) {
        try {
            SpringApplication app = new SpringApplication(WebframeApplication.class);
            Environment env = app.run(args).getEnvironment();
            app.addListeners();
            log.info("\n\t----------------------------------------------------------\n\t" +
                            "Application '{}' is running! Access Urls:\n\t" +
                            "Local: \t\thttp://localhost:{}\n\t" +
                            "Swagger API:http://localhost:{}/swagger-ui.html\n\t" +
                            "----------------------------------------------------------",
                    env.getProperty("spring.application.name"),
                    env.getProperty("server.port"),
                    env.getProperty("server.port"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}